<!DOCTYPE html>












  


<html class="theme-next gemini use-motion" lang="zh-CN">
<head><meta name="generator" content="Hexo 3.9.0">
  <!-- hexo-inject:begin --><!-- hexo-inject:end --><meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">












  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=7.2.0">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=7.2.0">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=7.2.0">


  <link rel="mask-icon" href="/images/logo.svg?v=7.2.0" color="#222">






<link rel="stylesheet" href="/css/main.css?v=7.2.0">






<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css?v=4.7.0">








<script id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Gemini',
    version: '7.2.0',
    sidebar: {"position":"left","display":"post","offset":12,"onmobile":false},
    back2top: {"enable":true,"sidebar":false,"scrollpercent":false},
    copycode: {"enable":false,"show_result":false,"style":null},
    fancybox: false,
    mediumzoom: false,
    lazyload: false,
    pangu: false,
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    },
    localsearch: {"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},
    search: {
      root: '/',
      path: ''
    },
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    translation: {
      copy_button: '复制',
      copy_success: '复制成功',
      copy_failure: '复制失败'
    }
  };
</script>

  <meta name="description" content="从Nimble了解到Apache的物联网操作系统mynewt，就想把玩一下，不过光是设置一个环境就非常的不容易，到处是坑儿，又找不到地方发问，感觉mynewt在国内根本没有机会。不像rt-thread，既有社区bbs，又有QQ群、微信群，问问题方便的很。 按照安装步骤一步一步操作，到目前还没build pass，先把遇到的问题整理下。 1.提示xcode太旧了，装不了。那我就update下呗，结果">
<meta name="keywords" content="mynewt">
<meta property="og:type" content="article">
<meta property="og:title" content="mynewt（一） 环境配置">
<meta property="og:url" content="http://yoursite.com/2021/05/03/mynewt-install/index.html">
<meta property="og:site_name" content="Wen Wu&#39;s notes">
<meta property="og:description" content="从Nimble了解到Apache的物联网操作系统mynewt，就想把玩一下，不过光是设置一个环境就非常的不容易，到处是坑儿，又找不到地方发问，感觉mynewt在国内根本没有机会。不像rt-thread，既有社区bbs，又有QQ群、微信群，问问题方便的很。 按照安装步骤一步一步操作，到目前还没build pass，先把遇到的问题整理下。 1.提示xcode太旧了，装不了。那我就update下呗，结果">
<meta property="og:locale" content="zh-CN">
<meta property="og:updated_time" content="2021-05-04T09:20:05.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="mynewt（一） 环境配置">
<meta name="twitter:description" content="从Nimble了解到Apache的物联网操作系统mynewt，就想把玩一下，不过光是设置一个环境就非常的不容易，到处是坑儿，又找不到地方发问，感觉mynewt在国内根本没有机会。不像rt-thread，既有社区bbs，又有QQ群、微信群，问问题方便的很。 按照安装步骤一步一步操作，到目前还没build pass，先把遇到的问题整理下。 1.提示xcode太旧了，装不了。那我就update下呗，结果">





  
  
  <link rel="canonical" href="http://yoursite.com/2021/05/03/mynewt-install/">



<script id="page.configurations">
  CONFIG.page = {
    sidebar: "",
  };
</script>

  
  <title>mynewt（一） 环境配置 | Wen Wu's notes</title>
  












  <noscript>
  <style>
  .use-motion .motion-element,
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-title { opacity: initial; }

  .use-motion .logo,
  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript><!-- hexo-inject:begin --><!-- hexo-inject:end -->

</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-CN">

  
  
    
  

  <!-- hexo-inject:begin --><!-- hexo-inject:end --><div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta">
    

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Wen Wu's notes</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
    
      
        <p class="site-subtitle">technical record</p>
      
    
    
  </div>

  <div class="site-nav-toggle">
    <button aria-label="切换导航栏">
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>



<nav class="site-nav">
  
    <ul id="menu" class="menu">
      
        
        
        
          
          <li class="menu-item menu-item-home">

    
    
      
    

    

    <a href="/" rel="section"><i class="menu-item-icon fa fa-fw fa-home"></i> <br>首页</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-about">

    
    
      
    

    

    <a href="/about/" rel="section"><i class="menu-item-icon fa fa-fw fa-user"></i> <br>关于</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-tags">

    
    
      
    

    

    <a href="/tags/" rel="section"><i class="menu-item-icon fa fa-fw fa-tags"></i> <br>标签</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-categories">

    
    
      
    

    

    <a href="/categories/" rel="section"><i class="menu-item-icon fa fa-fw fa-th"></i> <br>分类</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-archives">

    
    
      
    

    

    <a href="/archives/" rel="section"><i class="menu-item-icon fa fa-fw fa-archive"></i> <br>归档</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-schedule">

    
    
      
    

    

    <a href="/schedule/" rel="section"><i class="menu-item-icon fa fa-fw fa-calendar"></i> <br>日程表</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-sitemap">

    
    
      
    

    

    <a href="/sitemap.xml" rel="section"><i class="menu-item-icon fa fa-fw fa-sitemap"></i> <br>站点地图</a>

  </li>

      
      
    </ul>
  

  

  
</nav>



</div>
    </header>

    


    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          
            

          
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
      

  
  
  

  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2021/05/03/mynewt-install/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Wen Wu">
      <meta itemprop="description" content="I'm a bluetooth Host and Controller developer">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Wen Wu's notes">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">mynewt（一） 环境配置

              
            
          </h1>
        

        <div class="post-meta">

          
          
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              

              
                
              

              <time title="创建时间：2021-05-03 07:45:05" itemprop="dateCreated datePublished" datetime="2021-05-03T07:45:05+08:00">2021-05-03</time>
            </span>
          

          
            

            
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                
                  <span class="post-meta-item-text">更新于</span>
                
                <time title="修改时间：2021-05-04 17:20:05" itemprop="dateModified" datetime="2021-05-04T17:20:05+08:00">2021-05-04</time>
              </span>
            
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/操作系统/" itemprop="url" rel="index"><span itemprop="name">操作系统</span></a></span>

                
                
              
            </span>
          

          
          
            <span id="/2021/05/03/mynewt-install/" class="post-meta-item leancloud_visitors" data-flag-title="mynewt（一） 环境配置">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              
                <span class="post-meta-item-text">阅读次数：</span>
              
                <span class="leancloud-visitors-count"></span>
            </span>
          

          

          
            
  
  <span class="post-meta-item">
    
    <span class="post-meta-item-icon">
      <i class="fa fa-comment-o"></i>
    </span>
    
      <span class="post-meta-item-text">评论数：</span>
    
  
    <a href="/2021/05/03/mynewt-install/#comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2021/05/03/mynewt-install/" itemprop="commentCount"></span>
    </a>
  </span>
  
  
          

          <br>
          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>从Nimble了解到Apache的物联网操作系统mynewt，就想把玩一下，不过光是设置一个环境就非常的不容易，到处是坑儿，又找不到地方发问，感觉mynewt在国内根本没有机会。不像rt-thread，既有社区bbs，又有QQ群、微信群，问问题方便的很。</p>
<p>按照<a href="https://mynewt.apache.org/latest/newt/install/newt_mac.html">安装步骤</a>一步一步操作，到目前还没build pass，先把遇到的问题整理下。</p>
<p><strong>1.提示xcode太旧了，装不了。</strong>那我就update下呗，结果在AppStore下载不了，提示说空间不够，但我有40个G的可用空间呀，我就干脆直接删掉xcode，只装个命令行。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">sudo rm -rf /Library/Developer/CommandLineTools</span><br><span class="line">sudo xcode-select —install</span><br></pre></td></tr></table></figure>
<p><strong>2.接着装mynewt。</strong></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">$ brew tap JuulLabs-OSS/mynewt</span><br><span class="line">Error: Refusing to untap runtimeco/mynewt because it contains the following installed formulae or casks:mynewt-newt</span><br></pre></td></tr></table></figure>
<blockquote>
<p>解决方法：brew untap —force runtimeco/mynewt就可以了</p>
</blockquote>
<p><strong>3.update下brew </strong></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">Mac01:~ wnnwoo$ brew update</span><br><span class="line">Error: Fetching /usr/local/Homebrew failed!</span><br><span class="line">Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core failed!</span><br><span class="line">Fetching /usr/local/Homebrew/Library/Taps/juullabs-oss/homebrew-mynewt failed!</span><br><span class="line">Fetching /usr/local/Homebrew/Library/Taps/px4/homebrew-px4 failed!</span><br></pre></td></tr></table></figure>
<blockquote>
<p>试验了半天，才搞明白因为开启了VPN，不知道跟brew哪根筋冲突了，关掉VPN就OK</p>
</blockquote>
<p><strong>4.升级下mynewt的newt</strong><br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">$ brew upgrade mynewt-newt</span><br><span class="line">.....</span><br><span class="line">fatal: not a git repository (or any of the parent directories): .git</span><br><span class="line">Building newt.  This may take a minute...</span><br><span class="line">go: github.com/NickBall/go-aes-key-wrap@v0.0.0-20170929221519-1c3aa3e4dfc5: Get &quot;https://proxy.golang.org/github.com/%21nick%21ball/go-aes-key-wrap/@v/v0.0.0-20170929221519-1c3aa3e4dfc5.mod&quot;: dial tcp 172.217.160.113:443: i/o timeout</span><br></pre></td></tr></table></figure></p>
<blockquote>
<p>百度下有网友说是GO被长城给block了，要把GO的代理设置到国内.</p>
<blockquote>
<p>go env -w GOPROXY=<a href="https://goproxy.cn">https://goproxy.cn</a></p>
</blockquote>
<p>但我这里还是不行，看来不是这个问题，来来回回折腾来很久<br>最后找到个合适的，比较快的VPN，算是解决了这个问题。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">$ which newt</span><br><span class="line">/usr/local/bin/newt</span><br><span class="line">$ newt version</span><br><span class="line">Apache Newt version: 1.5.0</span><br></pre></td></tr></table></figure></p>
</blockquote>
<p><strong>5.接着装newtmgr。</strong><br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">Mac01:~ wnnwoo$ brew install mynewt-newtmgr</span><br><span class="line">Updating Homebrew...</span><br><span class="line">Error: Formulae found in multiple taps: </span><br><span class="line">       * juullabs-oss/mynewt/mynewt-newtmgr</span><br><span class="line">       * runtimeco/mynewt/mynewt-newtmgr</span><br></pre></td></tr></table></figure></p>
<blockquote>
<p>那就去掉一个，用 <code>Mac01:~ wnnwoo$ brew untap runtimeco/mynewt</code><br>然后再来一次<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">Mac01:~ wnnwoo$ brew install mynewt-newtmgr</span><br><span class="line">Warning: juullabs-oss/mynewt/mynewt-newtmgr 1.7.0 is already installed, it&apos;s just not linked.</span><br><span class="line">To link this version, run:</span><br><span class="line">  brew link mynewt-newtmgr</span><br></pre></td></tr></table></figure></p>
<p>看来已经装上了，只欠link，那就按照提示继续。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">Mac01:~ wnnwoo$ brew link mynewt-newtmgr</span><br><span class="line"></span><br><span class="line">Linking /usr/local/Cellar/mynewt-newtmgr/1.7.0... 1 symlinks created.</span><br><span class="line">Mac01:~ wnnwoo$ newtmgr</span><br><span class="line"></span><br><span class="line">Mac01:~ wnnwoo$ which newtmgr</span><br><span class="line">/usr/local/bin/newtmgr</span><br><span class="line">Mac01:~ wnnwoo$ newtmgr version</span><br><span class="line">Apache Newtmgr 1.7.0</span><br></pre></td></tr></table></figure></p>
<p>终于搞定了。</p>
</blockquote>
<p><strong>6.接着创建project，</strong>在当前目录下command <code>newt upgrade</code>，这个project相关的最基础所有软件包都会被拉下来，然后按照文档指示跑下测项。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br></pre></td><td class="code"><pre><span class="line"> Mac01:~ wnnwoo$ newt test @apache-mynewt-core/sys/config</span><br><span class="line"> </span><br><span class="line">       ...</span><br><span class="line">  &quot;_close$UNIX2003&quot;, referenced from:</span><br><span class="line">      _flash_native_file_open in @apache-mynewt-core_hw_mcu_native.a(hal_flash.o)</span><br><span class="line">      _native_sock_close in @apache-mynewt-core_net_ip_native_sockets.a(native_sock.o)</span><br><span class="line">      _uart_pty in @apache-mynewt-core_hw_mcu_native.a(hal_uart.o)</span><br><span class="line">      _uart_open_dev in @apache-mynewt-core_hw_mcu_native.a(hal_uart.o)</span><br><span class="line">      _hal_uart_close in @apache-mynewt-core_hw_mcu_native.a(hal_uart.o)</span><br><span class="line">  &quot;_getifaddrs&quot;, referenced from:</span><br><span class="line">      _native_sock_itf_getnext in @apache-mynewt-core_net_ip_native_sockets.a(native_itf.o)</span><br><span class="line">      _native_sock_itf_addr in @apache-mynewt-core_net_ip_native_sockets.a(native_itf.o)</span><br><span class="line">      _native_sock_itf_addr_getnext in @apache-mynewt-core_net_ip_native_sockets.a(native_itf.o)</span><br><span class="line">  &quot;_poll$UNIX2003&quot;, referenced from:</span><br><span class="line">      _socket_task in @apache-mynewt-core_net_ip_native_sockets.a(native_sock.o)</span><br><span class="line">  &quot;___bzero&quot;, referenced from:</span><br><span class="line">      _TEST_CASE_config_test_custom_compress in @apache-mynewt-core_sys_config_selftest-fcb2.a(config_test_custom_compress.o)</span><br><span class="line">  &quot;___stack_chk_fail&quot;, referenced from:</span><br><span class="line">      _ctest_handle_export in @apache-mynewt-core_sys_config_selftest-fcb2.a(conf_test_fcb2.o)</span><br><span class="line">      _c2_handle_export in @apache-mynewt-core_sys_config_selftest-fcb2.a(conf_test_fcb2.o)</span><br><span class="line">      _c3_handle_export in @apache-mynewt-core_sys_config_selftest-fcb2.a(conf_test_fcb2.o)</span><br><span class="line">      _conf_get_stored_value in @apache-mynewt-core_sys_config.a(config_store.o)</span><br><span class="line">      _conf_set_value in @apache-mynewt-core_sys_config.a(config.o)</span><br><span class="line">      _conf_get_value in @apache-mynewt-core_sys_config.a(config.o)</span><br><span class="line">      _conf_commit in @apache-mynewt-core_sys_config.a(config.o)</span><br><span class="line">      ...</span><br><span class="line">  &quot;___stdoutp&quot;, referenced from:</span><br><span class="line">      _tu_pass_cb_self in @apache-mynewt-core_test_testutil.a(testutil.o)</span><br><span class="line">      _tu_fail_cb_self in @apache-mynewt-core_test_testutil.a(testutil.o)</span><br><span class="line">  &quot;_openpty&quot;, referenced from:</span><br><span class="line">      _uart_pty in @apache-mynewt-core_hw_mcu_native.a(hal_uart.o)</span><br><span class="line">  &quot;_recvfrom$UNIX2003&quot;, referenced from:</span><br><span class="line">      _native_sock_recvfrom in @apache-mynewt-core_net_ip_native_sockets.a(native_sock.o)</span><br><span class="line">  &quot;___strncpy_chk&quot;, referenced from:</span><br><span class="line">      _c2_handle_get in @apache-mynewt-core_sys_config_selftest-fcb2.a(conf_test_fcb2.o)</span><br><span class="line">      _c2_handle_set in @apache-mynewt-core_sys_config_selftest-fcb2.a(conf_test_fcb2.o)</span><br><span class="line">      _conf_get_value_cb in @apache-mynewt-core_sys_config.a(config_store.o)</span><br><span class="line">      _native_sock_addr_to_mn_addr in @apache-mynewt-core_net_ip_native_sockets.a(native_sock.o)</span><br><span class="line">      _native_sock_itf_getnext in @apache-mynewt-core_net_ip_native_sockets.a(native_itf.o)</span><br><span class="line">ld: symbol(s) not found for architecture i386</span><br><span class="line">clang: error: linker command failed with exit code 1 (use -v to see invocation)</span><br><span class="line">Error: Test failure(s):</span><br><span class="line">Passed tests: []</span><br></pre></td></tr></table></figure></p>
<blockquote>
<p>看文档介绍号称mynewt支持gcc5，于是在<code>/repos/apache-mynewt-core/compiler/sim/compiler.yml</code>中config成gcc5, 看到明显不对，最基本的头文件都找不到。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"> Mac01:~ wnnwoo$ newt test @apache-mynewt-core/sys/config</span><br><span class="line">......</span><br><span class="line"> Testing package @apache-mynewt-core/sys/config/selftest-nffs</span><br><span class="line">Compiling repos/apache-mynewt-core/crypto/tinycrypt/src/aes_decrypt.c</span><br><span class="line">Compiling repos/apache-mynewt-mcumgr/cborattr/src/cborattr.c</span><br><span class="line">In file included from /usr/local/Cellar/gcc@5/5.5.0_6/lib/gcc/5/gcc/x86_64-apple-darwin17.7.0/5.5.0/include/stdint.h:9:0,</span><br><span class="line">                 from repos/apache-mynewt-core/crypto/tinycrypt/include/tinycrypt/aes.h:52,</span><br><span class="line">                 from repos/apache-mynewt-core/crypto/tinycrypt/src/aes_decrypt.c:33:</span><br><span class="line">/usr/local/Cellar/gcc@5/5.5.0_6/lib/gcc/5/gcc/x86_64-apple-darwin17.7.0/5.5.0/include-fixed/stdint.h:27:32: fatal error: sys/_types/_int8_t.h: No such file or directory</span><br><span class="line">compilation terminated.</span><br><span class="line">Error: Test failure(s):</span><br></pre></td></tr></table></figure></p>
<p>compiler.yml中再config成gcc6，依然是一堆error，还是很多基本的API 都link不到。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br></pre></td><td class="code"><pre><span class="line">Mac01:~ wnnwoo$ newt test @apache-mynewt-core/sys/config</span><br><span class="line">....</span><br><span class="line">ld: warning: The i386 architecture is deprecated for macOS (remove from the Xcode build setting: ARCHS)</span><br><span class="line">ld: warning: ignoring file /usr/local/Cellar/gcc@6/6.5.0_7/lib/gcc/6/libgcc_ext.10.5.dylib, missing required architecture i386 in file /usr/local/Cellar/gcc@6/6.5.0_7/lib/gcc/6/libgcc_ext.10.5.dylib (1 slices)</span><br><span class="line">ld: warning: ignoring file /usr/local/Cellar/gcc@6/6.5.0_7/lib/gcc/6/gcc/x86_64-apple-darwin20.3.0/6.5.0/libgcc.a, building for macOS-i386 but attempting to link with file built for macOS-x86_64</span><br><span class="line">ld: warning: ignoring file /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd, missing required architecture i386 in file /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd (3 slices)</span><br><span class="line">Undefined symbols for architecture i386:</span><br><span class="line">  &quot;_ioctl&quot;, referenced from:</span><br><span class="line">      _native_sock_bind in @apache-mynewt-core_net_ip_native_sockets.a(native_sock.o)</span><br><span class="line">     (maybe you meant: _hal_flash_ioctl)</span><br><span class="line">  &quot;_fcntl$UNIX2003&quot;, referenced from:</span><br><span class="line">      _native_sock_set_nonblocking in @apache-mynewt-core_net_ip_native_sockets.a(native_sock.o)</span><br><span class="line">      _set_nonblock in @apache-mynewt-core_hw_mcu_native.a(hal_uart.o)</span><br><span class="line">  &quot;___stdoutp&quot;, referenced from:</span><br><span class="line">      _tu_pass_cb_self in @apache-mynewt-core_test_testutil.a(testutil.o)</span><br><span class="line">      _tu_fail_cb_self in @apache-mynewt-core_test_testutil.a(testutil.o)</span><br><span class="line">  &quot;_fflush&quot;, referenced from:</span><br><span class="line">      _tu_pass_cb_self in @apache-mynewt-core_test_testutil.a(testutil.o)</span><br><span class="line">      _tu_fail_cb_self in @apache-mynewt-core_test_testutil.a(testutil.o)</span><br><span class="line">  &quot;_strtoul&quot;, referenced from:</span><br><span class="line">      _c2_var_find in @apache-mynewt-core_sys_config_selftest-fcb.a(conf_test_fcb.o)</span><br><span class="line">  &quot;_openpty&quot;, referenced from:</span><br><span class="line">      _uart_pty in @apache-mynewt-core_hw_mcu_native.a(hal_uart.o)</span><br><span class="line">  &quot;_recvfrom$UNIX2003&quot;, referenced from:</span><br><span class="line">      _native_sock_recvfrom in @apache-mynewt-core_net_ip_native_sockets.a(native_sock.o)</span><br><span class="line">  &quot;___strncpy_chk&quot;, referenced from:</span><br><span class="line">      _c2_handle_get in @apache-mynewt-core_sys_config_selftest-fcb.a(conf_test_fcb.o)</span><br><span class="line">      _c2_handle_set in @apache-mynewt-core_sys_config_selftest-fcb.a(conf_test_fcb.o)</span><br><span class="line">      _conf_get_value_cb in @apache-mynewt-core_sys_config.a(config_store.o)</span><br><span class="line">      _native_sock_addr_to_mn_addr in @apache-mynewt-core_net_ip_native_sockets.a(native_sock.o)</span><br><span class="line">      _native_sock_itf_getnext in @apache-mynewt-core_net_ip_native_sockets.a(native_itf.o)</span><br><span class="line">ld: symbol(s) not found for architecture i386</span><br><span class="line">collect2: error: ld returned 1 exit status</span><br><span class="line">Error: Test failure(s):</span><br><span class="line">Passed tests: []</span><br><span class="line">Failed tests: [sys/config/selftest-fcb2 sys/config/selftest-nffs sys/config/selftest-fcb]</span><br></pre></td></tr></table></figure></p>
</blockquote>
<p>看起来是跟64位的兼容性问题，查来查去，查到Xcode的<a href="https://developer.apple.com/documentation/xcode-release-notes/xcode-10-release-notes">Release notes</a>，看起来要安装旧的Xcode 9.4才行。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">The macOS 10.14 SDK no longer contains support for compiling 32-bit applications. If developers need to compile for i386, Xcode 9.4 or earlier is required. (39858111)</span><br></pre></td></tr></table></figure>
<p>后续再build下开发版上的binary试下，问题应该少些才对。<br>待续……</p>

      
    </div>

    

    
      
    

    
    
    

    

    
      
    
    

    

    <footer class="post-footer">
      
        
          
        
        <div class="post-tags">
          
            <a href="/tags/mynewt/" rel="tag"># mynewt</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2021/03/17/RunningCuresAll/" rel="next" title="跑步治愈一切">
                <i class="fa fa-chevron-left"></i> 跑步治愈一切
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2021/05/09/AliceBobCouple/" rel="prev" title="Alice和Bob">
                Alice和Bob <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>

  </div>


          </div>
          
  
    
    <div class="comments" id="comments"></div>
  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      

      <div class="site-overview-wrap sidebar-panel sidebar-panel-active">
        <div class="site-overview">

          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  
  <p class="site-author-name" itemprop="name">Wen Wu</p>
  <div class="site-description motion-element" itemprop="description">I'm a bluetooth Host and Controller developer</div>
</div>


  <nav class="site-state motion-element">
    
      <div class="site-state-item site-state-posts">
        
          <a href="/archives/">
        
          <span class="site-state-item-count">80</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
    

    
      
      
      <div class="site-state-item site-state-categories">
        
          
            <a href="/categories/">
          
        
        
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
        <span class="site-state-item-count">16</span>
        <span class="site-state-item-name">分类</span>
        </a>
      </div>
    

    
      
      
      <div class="site-state-item site-state-tags">
        
          
            <a href="/tags/">
          
        
        
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
        <span class="site-state-item-count">39</span>
        <span class="site-state-item-name">标签</span>
        </a>
      </div>
    
  </nav>













          
          
        </div>
      </div>

      

      

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2022</span>
  <span class="with-love" id="animate">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Wen Wu</span>

  

  
</div>


  <div class="powered-by">由 <a href="https://hexo.io" class="theme-link" rel="noopener" target="_blank">Hexo</a> 强力驱动 v3.9.0</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 – <a href="https://theme-next.org" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> v7.2.0</div>





  <script src="https://unpkg.com/mermaid@/dist/mermaid.min.js"></script>
  <script>
    if (window.mermaid) {
      mermaid.initialize("");
    }
  </script>



        








        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

    

    

  </div>

  

<script>
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>
















  
  









  
  <script src="/lib/jquery/index.js?v=3.4.1"></script>

  
  <script src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>




  <script src="/js/utils.js?v=7.2.0"></script>

  <script src="/js/motion.js?v=7.2.0"></script>



  
  


  <script src="/js/affix.js?v=7.2.0"></script>

  <script src="/js/schemes/pisces.js?v=7.2.0"></script>




  
  <script src="/js/scrollspy.js?v=7.2.0"></script>
<script src="/js/post-details.js?v=7.2.0"></script>



  <script src="/js/next-boot.js?v=7.2.0"></script>

  

  

  


  
  

  
  

  























<script>
if ($('body').find('pre.mermaid').length) {
  $.ajax({
    type: 'GET',
    url: '//cdn.jsdelivr.net/npm/mermaid@8/dist/mermaid.min.js',
    dataType: 'script',
    cache: true,
    success: function() {
      mermaid.initialize({
        theme: 'forest',
        logLevel: 3,
        flowchart: { curve: 'linear' },
        gantt: { axisFormat: '%m/%d/%Y' },
        sequence: { actorMargin: 50 }
      });
    }
  });
}
</script>


<script>
// GET RESPONSIVE HEIGHT PASSED FROM IFRAME

window.addEventListener("message", function(e) {
  var data = e.data;
  if ((typeof data === 'string') && (data.indexOf('ciu_embed') > -1)) {
    var featureID = data.split(':')[1];
    var height = data.split(':')[2];
    $(`iframe[data-feature=${featureID}]`).height(parseInt(height) + 30);
  }
}, false);
</script>








  
    

  

<script src="//cdn.jsdelivr.net/npm/valine@1/dist/Valine.min.js"></script>

<script>
  var GUEST = ['nick', 'mail', 'link'];
  var guest = 'nick,mail,link';
  guest = guest.split(',').filter(function(item) {
    return GUEST.indexOf(item) > -1;
  });
  new Valine({
    el: '#comments',
    verify: false,
    notify: false,
    appId: 'wteo2C9GdG6F2N92cktVar8K-gzGzoHsz',
    appKey: 'IBKrtkUwlKqPJ8FQsKkNP0K1',
    placeholder: 'Just go go',
    avatar: 'mm',
    meta: guest,
    pageSize: '10' || 10,
    visitor: true,
    lang: 'zh-cn' || 'zh-cn'
  });
</script><!-- hexo-inject:begin --><!-- Begin: Injected MathJax -->
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({"tex2jax":{"inlineMath":[["$","$"],["\\(","\\)"]],"skipTags":["script","noscript","style","textarea","pre","code"],"processEscapes":true},"TeX":{"equationNumbers":{"autoNumber":"AMS"}}});
</script>

<script type="text/x-mathjax-config">
  MathJax.Hub.Queue(function() {
    var all = MathJax.Hub.getAllJax(), i;
    for(i=0; i < all.length; i += 1) {
      all[i].SourceElement().parentNode.className += ' has-jax';
    }
  });
</script>

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js">
</script>
<!-- End: Injected MathJax -->
<!-- hexo-inject:end -->

  

</body>
</html>
